Skip to content

fix(cli): derive package name from project directory#2564

Closed
Will-thom wants to merge 1 commit into
software-mansion:mainfrom
Will-thom:will/typegpu-2543-single-project-prompt
Closed

fix(cli): derive package name from project directory#2564
Will-thom wants to merge 1 commit into
software-mansion:mainfrom
Will-thom:will/typegpu-2543-single-project-prompt

Conversation

@Will-thom
Copy link
Copy Markdown
Contributor

Summary

  • remove the separate package name prompt from the project creation flow
  • derive the package name from the selected project directory
  • keep scaffolding behavior unchanged after the directory step

Fixes #2543

Tests

  • corepack pnpm exec tsc --p packages/typegpu-cli/tsconfig.json --noEmit
  • corepack pnpm oxfmt --check packages/typegpu-cli/src/create.ts packages/typegpu-cli/src/utils/inputs.ts

Note: local Node is v22.21.1, while the repo asks for >=24.0.0; commands completed with the engine warning.

Copilot AI review requested due to automatic review settings May 26, 2026 15:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Removes the interactive package name prompt from the project creation flow, deriving the package name from the resolved project directory instead.

Changes:

  • Drops getPackageName and isValidPackageName from inputs.ts.
  • Uses path.basename(root) as the package name in create.ts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/typegpu-cli/src/utils/inputs.ts Removes unused getPackageName helper and its validator.
packages/typegpu-cli/src/create.ts Replaces interactive package name input with directory basename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const root = await prepareDirectory(cwd, projectDir);

const packageName = await getPackageName(projectDir);
const packageName = path.basename(root);
@aleksanderkatan
Copy link
Copy Markdown
Contributor

Done in #2565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(@typegpu/cli): Make "directory" and "package name" a single prompt

3 participants